package com.bitc.crash.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bitc.crash.model.entity.Commodity;
import com.bitc.crash.model.vo.CommodityVO;

/**
 * 商品服务接口
 */
public interface CommodityService extends IService<Commodity> {

    /**
     * 校验商品
     */
    void validCommodity(Commodity commodity, boolean add);

    /**
     * 获取查询条件
     */
    QueryWrapper<Commodity> getQueryWrapper(Commodity commodityQuery);

    /**
     * 获取商品封装
     */
    CommodityVO getCommodityVO(Commodity commodity);

    /**
     * 分页获取商品封装
     */
    Page<CommodityVO> getCommodityVOPage(Page<Commodity> commodityPage);
}